package com.pj.wisdomlogistics.mvp.presenter;


import com.pj.wisdomlogistics.mvp.contract.ApplyCarContract;
import com.pj.wisdomlogistics.mvp.frame.ActivityPresenter;
import com.pj.wisdomlogistics.mvp.model.ApplyCarModel;
import com.pj.wisdomlogistics.rx.FilterSubscriber;


public class ApplyCarPresenter extends ActivityPresenter<ApplyCarModel, ApplyCarContract.View> implements ApplyCarContract.Presenter {
    public static final String TAG = "ApplyCarPresenter";

    @Override
    public void submitCarApply(String userID, String userName, String userTel, String applyDeptID, String applyDept,
                               String officeTel, String applyReason, String goalPlace, String detailReason,
                               String peopleCount, String usingTime, String linkman, String linkmanTel ,
                               int isAfterApply , String place) {
        addSubscription(getModel().submitCarApply(userID,
                userName,
                userTel,
                applyDeptID,
                applyDept,
                officeTel,
                applyReason,
                goalPlace,
                detailReason,
                peopleCount,
                usingTime,
                linkman,
                linkmanTel,
                isAfterApply,
                place), new FilterSubscriber<Integer>() {
            @Override
            public void onNext(Integer mInteger) {
                getView().onSuccess(mInteger);
            }

            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().onError(errorMsg);
            }

        });
    }
}
